﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace vkUpploaderLib.Exceptions
{
    public class VkException : Exception
    {
        public VkExceptionsEnum Code;

        public VkException(string message, string code) :base(message)
        {
            try
            {
                int c = int.Parse(code);
                if (Enum.IsDefined(typeof(VkExceptionsEnum),c))
                {
                    Code = (VkExceptionsEnum) Enum.Parse(typeof(VkExceptionsEnum), code);
                }
            }
            catch 
            {
                
            }
        }
    }

    public enum VkExceptionsEnum
    {
        UserAuthorizationFailed = 5
    }
}
